how to deploy redis cluster on kubernetes1.19

  1. apply statefulset.yaml and create cluster(I used hostNetwork to avoid nodes.conf not being updated)

    curl -LO https://chenshi.de/redis-sts.yaml
    vi redis-sts.yaml
    kubectl apply -f redis-sts.yaml
    kubectl get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 '
    kubectl exec -it redis-cluster-0 -- redis-cli --cluster create --cluster-replicas 1 ips:ports
    
  2. references:

    https://rancher.com/blog/2019/deploying-redis-cluster

    https://stackoverflow.com/questions/58528831/is-it-possible-to-create-a-redis-cluster-within-kubernetes-using-a-istio-search

    https://redis-py-cluster.readthedocs.io/en/stable/

    https://blog.csdn.net/u012361112/article/details/102896627

    https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster